Add category field to ComponentType and ComponentTypeInput#613
Add category field to ComponentType and ComponentTypeInput#613saditya370 wants to merge 2 commits intomainfrom
Conversation
wesleyjellis
left a comment
There was a problem hiding this comment.
2 major questions:
-
How does this work without the feature flag? I'm pretty sure infrastructure component types are gated behind a feature flag, and I'm not sure what happens if you try to make one without the feature flag
-
Do we need the people category? It looks like we don't let you make people componenttypes inside opslevel, so I think we should drop it from any tests, at least as far as creating them goes... Is that going to cause a problem if you try to manage your componenttypes with Terraform though? ie: terraform tries to delete all the component types it doesn't know about?
Flag: Backend gates category behind infra_component_types_ui on both input and output. Without the flag the field is just absent from the schema, so the SDK sends nothing (omitempty) and reads come back as "". Flagless accounts are unaffected. Added a note to the schema docs + changelog. people: Dropped. Validator is now ("default", "infrastructure") and the test fixtures don't reference people anymore. No drift risk for existing people-category types — the provider only touches what's in the config, it doesn't enumerate-and-delete unmanaged types. Only edge case is if someone imports a people type into state, which would hit the validator. |
Summary
CategorytoComponentTypeInput(write) andComponentType(read), backing the recently-publiccategoryfield oncomponentTypeCreate/componentTypeUpdateand theComponentTypetype.default,infrastructure,people. Settinginfrastructuresurfaces the component type in the Infrastructure catalog.Test plan
go test ./...passescategoryand assert it on the responsecategoryis populated on all three fixtures